﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>登录-{$site_name}</title>

<link rel="stylesheet" href="CSS/login.css"> 

</head>
<body style="background: url('{$site_img}') no-repeat;;background-size:cover;width: 100%;height: 100%">
<div id="login">
    <div class="warp">
        <div id="logo">
            <p style="text-align: center">{Go:global name="site_name"/}</p>
        </div>
        <div class="content">
            <form action="" method="post" name="login_main" id="login_main" style="margin-top: 80px">
                <div class="item"><div class="input"><div class="icon" title="学号"></div><input value="" tabindex="1" id="student_id" type="text" name="student_id" /></div><label>学号：</label></div>
                <div class="item"><div class="input"><div class="icon2" title="密码"></div><input value="" tabindex="2" id="student_password" type="password" name="student_password" /></div><label>密码：</label></div>
                <div class="item"><p style="text-align: center"><a href="{:U('/admin/Login/index')}" style="color:#0e0e0e;text-decoration: none;">教师登录</a></p></div>
                <input type="button" value="" class="submit" />
            </form>
        </div>   
    </div>
</div>

<script  type="text/javascript"  src="JS/jquery-1.8.3.min.js"></script>

<script type='text/javascript'>
$(function(){
  $('.submit').click(function(){
    var student_id=$("#student_id").val();
    var student_password=$("#student_password").val();
    if(student_password==""||student_id==""){
        alert('学号与密码不能为空 ');
        $("#student_id").focus();
        return false;
    }else{
        var url = "{:U('home/index/login')}";
        $.post(url, { student_id:student_id, student_password:student_password}, function(msg){
        if(msg.info == 'ok') {
          window.location.href = msg.callback;
        } else {
          alert(msg.info);
        }
      }, 'json').error(function(){
        alert("网络连接错误，请稍后再试");
      });

    }
  })

});
</script>
</body>
</html>